package com.hcc.repository.gen.engine;

import com.hcc.repository.gen.constants.TemplateEngineType;
import com.hcc.repository.gen.engine.impl.FreemarkerTemplateEngine;
import com.hcc.repository.gen.engine.impl.VelocityTemplateEngine;

import java.util.HashMap;
import java.util.Map;

/**
 * TemplateEngineFactory
 *
 * @author hushengjun
 * @date 2023/9/28
 */
public class TemplateEngineFactory {

    private static final Map<TemplateEngineType, TemplateEngine> templateEngineMap = new HashMap<>(2);
    static {
        templateEngineMap.put(TemplateEngineType.FREEMARKER, new FreemarkerTemplateEngine());
        templateEngineMap.put(TemplateEngineType.VELOCITY, new VelocityTemplateEngine());
    }

    public static TemplateEngine getTemplateEngine(TemplateEngineType engineType) {
        return templateEngineMap.get(engineType);
    }

}
